//
//  UIViewController+BundleName.m
//  EpubSDK
//
//  Created by linziyuan on 16/12/7.
//  Copyright © 2016年 creative. All rights reserved.
//

#import "UIViewController+BundleName.h"
#import "NSObject+Telen.h"

@implementation UIViewController (BundleName)

+ (void)load
{
    [self swizzleSelector:@selector(initWithNibName:bundle:) withSelector:@selector(jrsdk_InitWithNibName:bundle:)];
}

- (instancetype)jrsdk_InitWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil{
    NSBundle *finalBundel = nibBundleOrNil;
    if (!finalBundel) {
        finalBundel = [NSBundle bundleForClass:NSClassFromString(nibNameOrNil)];
    }
    return [self jrsdk_InitWithNibName:nibNameOrNil bundle:finalBundel];
}

@end
